home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / ld.man < prev    next >
Encoding:
Text File  |  1989-01-05  |  9.7 KB  |  265 lines

  1.  
  2.  
  3.  
  4. LD                        User Commands                        LD
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      ld - link editor
  10.  
  11. SSYYNNOOPPSSIISS
  12.      lldd [ --aalliiggnn _d_a_t_u_m ] [ --AA _n_a_m_e ] [ --dd ] [ --DD _h_e_x ]
  13.           [ --ee _e_n_t_r_y ] [ --ll_x ] [ --LL_d_i_r ] [ --MM ] [ --nn ]
  14.           [ --NN ] [ --oo _n_a_m_e ] [ --rr ] [ --ss ] [ --SS ] [ --tt ]
  15.           [ --TT[tteexxtt]_h_e_x ] [ --TTddaattaa _h_e_x ] [ --uu _n_a_m_e ]
  16.           [ --xx ] [ --XX ] [ --yy_s_y_m ] [ --zz ] _f_i_l_e_n_a_m_e...
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      _l_d combines several object programs into one, resolves
  20.      external references, and searches libraries.  In the sim-
  21.      plest case several object _f_i_l_e_n_a_m_es are given, and _l_d com-
  22.      bines them, producing an object module which can either be
  23.      executed or become the input for a subsequent _l_d run.  In
  24.      the latter case, the --rr option must be given to preserve the
  25.      relocation bits. The output of _l_d is left on a file called
  26.      _a.._o_u_t if not otherwise specified.  The output file is made
  27.      executable only if no errors occurred during link editing.
  28.  
  29.      Files specified by the argument _f_i_l_e_n_a_m_e ... are con-
  30.      catenated in the order specified.  The entry point of the
  31.      output is the beginning of the first routine, unless the --ee
  32.      option is specified.
  33.  
  34.      If a named file is a library, it is searched exactly once at
  35.      the point it is encountered in the argument list.  Only
  36.      those routines defining an unresolved external reference are
  37.      loaded.  If a routine from a library references another rou-
  38.      tine in the same library, and the library has not been pro-
  39.      cessed by _r_a_n_l_i_b, the referenced routine must appear after
  40.      the referencing routine in the library.  Thus the order of
  41.      programs within libraries may be important.  The first
  42.      member of a library should be a file named `__.SYMDEF',
  43.      which is understood to be a dictionary for the library as
  44.      produced by _r_a_n_l_i_b; the dictionary is searched iteratively
  45.      to satisfy as many references as possible.
  46.  
  47.      The symbols __eetteexxtt, __eeddaattaa and __eenndd (eetteexxtt, eeddaattaa and eenndd in
  48.      C) are reserved, and if referred to, are set to the first
  49.      location above the program, the first location above ini-
  50.      tialized data, and the first location above all data,
  51.      respectively.  It is erroneous to define these symbols.
  52.  
  53. OOPPTTIIOONNSS
  54.      Options should appear before the _f_i_l_e_n_a_m_e_s, except abbrevi-
  55.      ated library names specified by the --ll option, which can
  56.      appear anywhere.
  57.  
  58.      --aalliiggnn _d_a_t_u_m
  59.           _d_a_t_u_m (usually a FORTRAN common block) is increased in
  60.  
  61.  
  62.  
  63. Sprite v1.0               17 July 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LD                        User Commands                        LD
  71.  
  72.  
  73.  
  74.           length to be a multiple of the page size; its beginning
  75.           is set at a page boundary.
  76.  
  77.      --AA _n_a_m_e
  78.           Incremental loading: linking is to be done in a manner
  79.           so that the resulting object may be read into an
  80.           already executing program. _n_a_m_e is the name of a file
  81.           whose symbol table is taken as a basis on which to
  82.           define additional symbols.  Only newly linked material
  83.           is entered into the text and data portions of _a.._o_u_t,
  84.           but the new symbol table will reflect all symbols
  85.           defined before and after the incremental load.  This
  86.           argument must appear before any other object file in
  87.           the argument list.  One or both of the --TT options may
  88.           be used as well, and will be taken to mean that the
  89.           newly linked segment will commence at the corresponding
  90.           addresses (which must be a multiple of the page size).
  91.           The default value is the old value of __eenndd.
  92.  
  93.      --dd   Force definition of common storage even if the --rr flag
  94.           is present.
  95.  
  96.      --DD _h_e_x
  97.           Pad the data segment with zero-valued bytes to make it
  98.           _h_e_x bytes long.
  99.  
  100.      --ee _e_n_t_r_y
  101.           Define the eentry point: the _e_n_t_r_y argument is made the
  102.           name of the entry point of the loaded program.
  103.  
  104.      --ll_x  This option is an abbreviation for the library name
  105.           lliibb_x..aa, where _x is a string. _l_d searches for libraries
  106.           first in any directories specified with --LL options,
  107.           then in the standard directory //sspprriittee//lliibb//_t_m..mmdd, where
  108.           _t_m is the target machine on which the linked program is
  109.           intended to execute.  _T_m defaults to the value of the
  110.           MMAACCHHIINNEE environment variable, but may be overridden
  111.           with the --mm switch.  A library is searched when its
  112.           name is encountered, so the placement of a --ll is signi-
  113.           ficant.
  114.  
  115.      --LL_d_i_r
  116.           Add _d_i_r to the list of directories in which libraries
  117.           are searched for.  Directories specified with --LL are
  118.           searched before the standard directory.
  119.  
  120.      --mm_t_m Use _t_m as the target machine for this link, rather than
  121.           the MMAACCHHIINNEE environment variable.  This switch deter-
  122.           mines where the linker looks for libraries (see the --ll
  123.           switch above).
  124.  
  125.      --MM   Produce a primitive load map, listing the names of the
  126.  
  127.  
  128.  
  129. Sprite v1.0               17 July 1986                          2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. LD                        User Commands                        LD
  137.  
  138.  
  139.  
  140.           files which will be loaded.
  141.  
  142.      --nn   Arrange (by giving the output file a 0410 `magic
  143.           number') that when the output file is executed, the
  144.           text portion will be read-only and shared among all
  145.           processes executing the file.  This involves moving the
  146.           data areas up to the first possible segment boundary
  147.           following the end of the text.
  148.  
  149.      --NN   Do not make the text portion read-only or sharable.
  150.           (Use `magic number' 0407.)
  151.  
  152.      --oo _n_a_m_e
  153.           _N_a_m_e is made the name of the _l_d output file, instead of
  154.           aa..oouutt.
  155.  
  156.      --rr   Generate relocation bits in the output file so that it
  157.           can be the subject of another _l_d run.  This flag also
  158.           prevents final definitions from being given to common
  159.           symbols, and suppresses the `undefined symbol' diagnos-
  160.           tics.
  161.  
  162.      --ss   Strip the output, that is, remove the symbol table and
  163.           relocation bits to save space (but impair the useful-
  164.           ness of the debuggers).  This information can also be
  165.           removed by _s_t_r_i_p(1).
  166.  
  167.      --SS   Strip the output by removing all symbols except locals
  168.           and globals.
  169.  
  170.      --tt   Trace: display the name of each file as it is pro-
  171.           cessed.
  172.  
  173.      --TT[tteexxtt]_h_e_x
  174.           Start the text segment at location _h_e_x.  Specifying --TT
  175.           is the same as using the --TTtteexxtt option.
  176.  
  177.      --TTddaattaa _h_e_x
  178.           Start the data segment at location _h_e_x.  This option is
  179.           only of use to programmers wishing to write code for
  180.           PROMs, since the resulting code cannot be executed by
  181.           the UNIX system.
  182.  
  183.      --uu _n_a_m_e
  184.           Enter _n_a_m_e as an uundefined symbol.  This is useful for
  185.           loading wholly from a library, since initially the sym-
  186.           bol table is empty and an unresolved reference is
  187.           needed to force the loading of the first routine.
  188.  
  189.      --xx   Preserve only global (non-..gglloobbll) symbols in the output
  190.           symbol table; only enter external symbols.  This option
  191.           saves some space in the output file.
  192.  
  193.  
  194.  
  195. Sprite v1.0               17 July 1986                          3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. LD                        User Commands                        LD
  203.  
  204.  
  205.  
  206.      --XX   Record local symbols, except for those whose names
  207.           begin with `L'.  This option is used by _c_c to discard
  208.           internally generated labels while retaining symbols
  209.           local to routines.
  210.  
  211.      --yy_s_y_m
  212.           Display each file in which _s_y_m appears, its type and
  213.           whether the file defines or references it.  Many such
  214.           options may be given to trace many symbols.  It is usu-
  215.           ally necessary to begin _s_y_m with an `_', as external C,
  216.           FORTRAN and Pascal variables begin with underscores.
  217.  
  218.      --zz   Arrange for the process to be loaded on demand from the
  219.           resulting executable file (0413 `magic number') rather
  220.           than preloaded.  This is the default.  Results in a
  221.           (32-byte) header on the output file followed by text
  222.           and data segments, each of which has a multiple of
  223.           page-size bytes (being padded out with nulls in the
  224.           file if necessary).  With this format the first few BSS
  225.           segment symbols may actually end up in the data seg-
  226.           ment; this is to avoid wasting the space resulting from
  227.           rounding the data segment size.  The text is read-only
  228.           and shared among all processes executing the file.
  229.  
  230. FFIILLEESS
  231.      /lib/lib*.a            libraries
  232.      /usr/lib/lib*.a        more libraries
  233.      /usr/local/lib/lib*.a  still more libraries
  234.      a.out                  output file
  235.  
  236. SSEEEE AALLSSOO
  237.      as(1), ar(1), cc(1V), ranlib(1), strip(1)
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261. Sprite v1.0               17 July 1986                          4
  262.  
  263.  
  264.  
  265.